package com.heima.aliyun.green;

import com.heima.aliyun.green.config.ImageGreenScan;
import com.heima.aliyun.green.config.TextGreenScan;

import java.util.List;
import java.util.Map;

public class AliyunGreenTemplate {
    private ImageGreenScan imageGreenScan;
    private TextGreenScan textGreenScan;

    public AliyunGreenTemplate(ImageGreenScan imageGreenScan, TextGreenScan textGreenScan) {
        this.imageGreenScan = imageGreenScan;
        this.textGreenScan = textGreenScan;
    }

    // 暴露文本审核方法
    public Map<String, String> textScan(String content) throws Exception {
        return textGreenScan.textGreenScan(content);
    }

    // 暴露图片URL审核方法
    public Map<String, String> imageScanByUrl(List<String> urls) {
        return imageGreenScan.imageGreenScanForUrl(urls);
    }

    // 暴露图片字节数组审核方法（可选）
    public Map<String, String> imageScanByBytes(List<byte[]> bytesList) {
        return imageGreenScan.imageGreenScanForStream(bytesList);
    }

}
